from pymysql import Connection
from pojo import Budget

conn = Connection(
    host='localhost',
    port=3306,
    user='root',
    password='admin'
)

conn.select_db('excel')

cursor = conn.cursor()

cursor.execute("select budget_agency, budget_date, project, project_detail from budget_monitor")

results: tuple = cursor.fetchall()

result_list: Budget = []

for r in results:
    budget = Budget(r[0], r[1], r[2], r[3])
    result_list.append(budget)

for result in result_list:
    print(result)


